package com.tjc.spring.core;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * @Author: tjc
 * @description
 * @Date Created in 22:54 2021-12-20
 */
public class ConstructArgument {
    List<ValueHolder> valueHolders = new ArrayList<>();

    public List<ValueHolder> getValueHolders() {
        return Collections.unmodifiableList(valueHolders);
    }

    public void addValueHandler(ValueHolder holder) {
        valueHolders.add(holder);
    }

    public int size() {
        return valueHolders.size();
    }

    public boolean isEmpty() {
        return valueHolders.isEmpty();
    }

    public static class ValueHolder {
        private Object value;
        private String type;
        private String name;

        public ValueHolder(Object value) {
            this.value = value;
        }

        public ValueHolder(Object value, String type) {
            this.value = value;
            this.type = type;
        }

        public ValueHolder(Object value, String type, String name) {
            this.value = value;
            this.type = type;
            this.name = name;
        }

        public Object getValue() {
            return value;
        }

        public void setValue(Object value) {
            this.value = value;
        }

        public String getType() {
            return type;
        }

        public void setType(String type) {
            this.type = type;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }
}


